POV-Ray : Newsgroups : povray.general : Status of Moray? : Re: New SDL for POVRay Server Time
5 Jul 2025 06:57:47 EDT (-0400)
  Re: New SDL for POVRay  
From: Darren New
Date: 10 Oct 2007 11:16:39
Message: <470cecd7@news.povray.org>
Patrick Elliott wrote:
> that, "If you are going to store that stuff in an array, lets at least 
> assign the array to something that "looks" like its part of the object, 
> and not some separate entity." In other words, if you are going to apply 
> 10 transforms to object Z, then *make that array* part of the Z object, 
> *at least* from the perspective of the coder.

Why not just allow arrays that can be indexed by objects? Then you can 
have multiple arrays of transformations per object. You could have a 
"walking" array, indexed by body part, where each element is an array of 
transforms to be applied at each step of the walk cycle, then a 
"running" array indexed by body parts ....

Walking gets
object arm = cylinder(....)
object leg = blob(...)
translate(arm, walk[arm].translates[frame % 6])
rotate(arm, walk[arm].rotates[frame % 6])
translate(leg, walk[leg].mytranslate[frame % 6])

Running gets
object arm = cylinder(....)
object leg = blob(...)
translate(arm, run[arm].translates[frame % 6])
rotate(arm, run[arm].rotates[frame % 6])
translate(leg, run[leg].translates[frame % 6])

 > That way you can tell
> "what" they belong to by simply referencing the object they belong to, 
> not some arbitrary array that has no association, save that you just 
> happen to use it for that.

Arbitrary associations is the meat of programming. There's no real 
reason that a translation "belongs" more to an object than to an 
animation cycle than to a room of the house you're modeling.

-- 
   Darren New / San Diego, CA, USA (PST)
     Remember the good old days, when we
     used to complain about cryptography
     being export-restricted?


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.